// // src/router/index.js
import { createRouter, createWebHistory } from 'vue-router'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/main',
      name: 'main',
      component: () => import('../menu/main.vue'),
      children:[
        {
          path: '/menu',
          name: 'menu',
          component: () => import('../menu/MenuManagement.vue'),
        },
        {
          path: '/menuBusiness',
          name: 'menuBusiness',
          component: () => import('../menu/MenuBusinessManagement.vue'),
        },

        {
          path: '/menuUser',
          name: 'menuUser',
          component: () => import('../menu/MenuUSerManagement.vue'),
        },
        {
          path: '/products',
          name: 'productManage',
          component: () => import('../view/admin/ProductManage.vue'),
        },
        {
          path: '/orders',
          name: 'ordersManage',
          component: () => import('../view/admin/OrdersManage.vue'),
        },
        {
          path: '/category-brand',
          name: 'category-brand',
          component: () => import('../view/admin/category-brand.vue'),
        },
        {
          path: '/usermanagement',
          name: 'usermanagement',
          component: () => import('../view/UserManagement.vue'),
        },

      ]},
    {
      path: '/main3',
      name: 'mian3',
      component: () => import('../menu/main3.vue'),
      children:[

        {
          path: '/category-list',
          name: 'category-list',
          component: () => import('../view/user/category-list.vue'),
        },
        {
          path: '/productDetail/:productId',
          name: 'productDetail',
          component: () => import('../view/user/productDetail.vue'),
        },

      ]

    },
    {
      path: '/',
      name: 'user',
      component: () => import('../user/user.vue'),
    },
    {
      path: '/selection',
      name: 'selection',
      component: () => import('../view/admin/Selection.vue'),
    },
    {
      path: '/login2',
      name: 'login2',
      component: () => import('../menu/login2.vue'),
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../menu/login.vue'),
    },


  ],
})
export default router

